/*
 * Copyright (C) 2009 2DAI
 *
 * Este programa es Software Libre; usted puede redistribuirlo
 * y/o modificarlo bajo los términos de la "GNU General Public
 * License" como lo publica la "FSF Free Software Foundation",
 * o (a su elección) de cualquier versión posterior.
 *
 * Este programa es distribuido con la esperanza de que le será
 * útil, pero SIN NINGUNA GARANTIA; incluso sin la garantía
 * implícita por el MERCADEO o EJERCICIO DE ALGUN PROPOSITO en
 * particular. Vea la "GNU General Public License" para más
 * detalles.
 *
 * Usted debe haber recibido una copia de la "GNU General Public
 * License" junto con este programa, si no, escriba a la "FSF
 * Free Software Foundation, Inc.", 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 */
/*
 * MaintClub.java
 *
 * Created on 05-feb-2009, 8:47:17
 */
package gui;

import on.Clubs;
/**
 *
 * Author: Daniel Alberto Ambrosio
 */
public class MaintClub extends logic.ContentiPanel<Clubs> {

    /** Creates new form MaintClub */
    public MaintClub() {
        initComponents();
    }
    //metodo en el que paso el contenido de los campos al objeto CLUB

    public void setContenido(Clubs c) {
        this.JTFcolorCamisetas.setText(c.getColorCamisetas());
        this.JTFdni.setText(String.valueOf(c.getDni()));
        this.JTFemail.setText(c.getEmail());
        this.JTFDireccion.setText(c.getDireccion());
        this.JTFFax.setText(String.valueOf(c.getFax()));
        this.JTFMovil.setText(String.valueOf(c.getMovil()));
        this.JTFNombre.setText(c.getNombre());
        this.JTFPoblacion.setText(c.getPoblacion());
        this.JTFProvincia.setText(c.getProvincia());
        this.JTFTelefono.setText(String.valueOf(c.getTelefono()));
        this.JTFmarcaBola.setText(c.getMarcaBola());
        this.JTFnumero.setText(String.valueOf(c.getNumero()));
        this.JTFpersonaContacto.setText(c.getPersonaContacto());
        this.repaint();
    }
    //metodo que muestra el contenido y lo comprime en el objeto CLUB

    public Clubs getContenido() {
        Clubs c = new Clubs();
        c.setColorCamisetas(this.JTFcolorCamisetas.getText());
        c.setDireccion(this.JTFDireccion.getText());
        c.setDni(Integer.parseInt(this.JTFdni.getText()));
        c.setEmail(this.JTFemail.getText());
        c.setFax(Integer.parseInt(this.JTFFax.getText()));
        c.setMarcaBola(this.JTFmarcaBola.getText());
        c.setMovil(Integer.parseInt(this.JTFMovil.getText()));
        c.setNombre(this.JTFNombre.getText());
        c.setNumero(Integer.parseInt(this.JTFnumero.getText()));
        c.setPersonaContacto(this.JTFpersonaContacto.getText());
        c.setPoblacion(this.JTFPoblacion.getText());
        c.setProvincia(this.JTFProvincia.getText());
        c.setTelefono(Integer.parseInt(this.JTFTelefono.getText()));
        return c;
    }

    //Metodo que se hereda para poner los setEnabled(boo) de todos los TextFields
    @Override
    public void enableTextFields(boolean boo) {

        JTFDireccion.setEnabled(boo);
        JTFFax.setEnabled(boo);
        JTFMovil.setEnabled(boo);
        JTFNombre.setEnabled(boo);
        JTFPoblacion.setEnabled(boo);
        JTFProvincia.setEnabled(boo);
        JTFTelefono.setEnabled(boo);
        JTFcolorCamisetas.setEnabled(boo);
        JTFdni.setEnabled(boo);
        JTFemail.setEnabled(boo);
        JTFmarcaBola.setEnabled(boo);
        JTFnumero.setEnabled(boo);
        JTFpersonaContacto.setEnabled(boo);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JTPdatosClub = new javax.swing.JTabbedPane();
        JPDatosClub = new javax.swing.JPanel();
        JLNombre = new javax.swing.JLabel();
        JLDireccion = new javax.swing.JLabel();
        JLPoblacion = new javax.swing.JLabel();
        JLProvincia = new javax.swing.JLabel();
        JLTelefono = new javax.swing.JLabel();
        JTFProvincia = new javax.swing.JTextField();
        JLFax = new javax.swing.JLabel();
        JTFFax = new javax.swing.JTextField();
        JTFTelefono = new javax.swing.JTextField();
        JLMovil = new javax.swing.JLabel();
        JTFMovil = new javax.swing.JTextField();
        JTFNombre = new javax.swing.JTextField();
        JTFPoblacion = new javax.swing.JTextField();
        JTFDireccion = new javax.swing.JTextField();
        JTFnumero = new javax.swing.JTextField();
        JLnumero = new javax.swing.JLabel();
        JLdni = new javax.swing.JLabel();
        JTFdni = new javax.swing.JTextField();
        JPFisicoClub = new javax.swing.JPanel();
        JPClub = new javax.swing.JPanel();
        JLmarcaBola = new javax.swing.JLabel();
        JTFmarcaBola = new javax.swing.JTextField();
        JTFcolorCamisetas = new javax.swing.JTextField();
        JLcolorCamisetas = new javax.swing.JLabel();
        JPcontacto = new javax.swing.JPanel();
        JLpersonaContacto = new javax.swing.JLabel();
        JLemail = new javax.swing.JLabel();
        JTFemail = new javax.swing.JTextField();
        JTFpersonaContacto = new javax.swing.JTextField();

        JLNombre.setText("Nombre");

        JLDireccion.setText("Dirección");

        JLPoblacion.setText("Población");

        JLProvincia.setText("Provincia");

        JLTelefono.setText("Teléfono");

        JLFax.setText("Fax");

        JLMovil.setText("Movil");

        JLnumero.setText("Numero");

        JLdni.setText("DNI");

        javax.swing.GroupLayout JPDatosClubLayout = new javax.swing.GroupLayout(JPDatosClub);
        JPDatosClub.setLayout(JPDatosClubLayout);
        JPDatosClubLayout.setHorizontalGroup(
            JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPDatosClubLayout.createSequentialGroup()
                .addContainerGap(39, Short.MAX_VALUE)
                .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(JLDireccion)
                    .addComponent(JLNombre)
                    .addComponent(JLnumero)
                    .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(JLTelefono)
                        .addComponent(JLPoblacion)))
                .addGap(43, 43, 43)
                .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JTFnumero, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(JPDatosClubLayout.createSequentialGroup()
                        .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(JTFTelefono, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(JTFNombre, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(JPDatosClubLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JTFDireccion, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE))
                    .addComponent(JTFPoblacion, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE))
                .addGap(52, 52, 52)
                .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JLdni)
                    .addComponent(JLProvincia)
                    .addComponent(JLFax)
                    .addComponent(JLMovil))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(JTFProvincia, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE)
                    .addComponent(JTFFax)
                    .addComponent(JTFMovil)
                    .addComponent(JTFdni))
                .addGap(85, 85, 85))
        );
        JPDatosClubLayout.setVerticalGroup(
            JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPDatosClubLayout.createSequentialGroup()
                .addGap(37, 37, 37)
                .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFnumero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLnumero))
                .addGap(18, 18, 18)
                .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLNombre)
                    .addComponent(JTFNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JTFdni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLdni))
                .addGap(18, 18, 18)
                .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFProvincia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLProvincia)
                    .addComponent(JTFDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLDireccion))
                .addGap(18, 18, 18)
                .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFFax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLFax)
                    .addComponent(JTFPoblacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLPoblacion))
                .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JPDatosClubLayout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addGroup(JPDatosClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(JTFTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JLMovil)
                            .addComponent(JLTelefono)))
                    .addGroup(JPDatosClubLayout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(JTFMovil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(64, Short.MAX_VALUE))
        );

        JTPdatosClub.addTab("Datos CLUB", JPDatosClub);

        JPClub.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Club", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(51, 51, 51))); // NOI18N

        JLmarcaBola.setText("Marca Bola");

        JLcolorCamisetas.setText("Color Camisetas");

        javax.swing.GroupLayout JPClubLayout = new javax.swing.GroupLayout(JPClub);
        JPClub.setLayout(JPClubLayout);
        JPClubLayout.setHorizontalGroup(
            JPClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, JPClubLayout.createSequentialGroup()
                .addContainerGap(70, Short.MAX_VALUE)
                .addGroup(JPClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JLmarcaBola)
                    .addComponent(JLcolorCamisetas))
                .addGap(33, 33, 33)
                .addGroup(JPClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(JTFcolorCamisetas)
                    .addComponent(JTFmarcaBola, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE))
                .addGap(68, 68, 68))
        );
        JPClubLayout.setVerticalGroup(
            JPClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPClubLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(JPClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFmarcaBola, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLmarcaBola))
                .addGap(18, 18, 18)
                .addGroup(JPClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLcolorCamisetas)
                    .addComponent(JTFcolorCamisetas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(51, 51, 51))
        );

        JPcontacto.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Contacto", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(51, 51, 51))); // NOI18N

        JLpersonaContacto.setText("Persona Contacto");

        JLemail.setText("Email");

        javax.swing.GroupLayout JPcontactoLayout = new javax.swing.GroupLayout(JPcontacto);
        JPcontacto.setLayout(JPcontactoLayout);
        JPcontactoLayout.setHorizontalGroup(
            JPcontactoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPcontactoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JPcontactoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JLpersonaContacto)
                    .addComponent(JLemail))
                .addGap(15, 15, 15)
                .addGroup(JPcontactoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(JTFpersonaContacto)
                    .addComponent(JTFemail, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE))
                .addContainerGap(29, Short.MAX_VALUE))
        );
        JPcontactoLayout.setVerticalGroup(
            JPcontactoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPcontactoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JPcontactoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLpersonaContacto)
                    .addComponent(JTFpersonaContacto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JPcontactoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLemail)
                    .addComponent(JTFemail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(23, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout JPFisicoClubLayout = new javax.swing.GroupLayout(JPFisicoClub);
        JPFisicoClub.setLayout(JPFisicoClubLayout);
        JPFisicoClubLayout.setHorizontalGroup(
            JPFisicoClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPFisicoClubLayout.createSequentialGroup()
                .addGroup(JPFisicoClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JPFisicoClubLayout.createSequentialGroup()
                        .addGap(97, 97, 97)
                        .addComponent(JPcontacto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(JPFisicoClubLayout.createSequentialGroup()
                        .addGap(55, 55, 55)
                        .addComponent(JPClub, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(101, Short.MAX_VALUE))
        );
        JPFisicoClubLayout.setVerticalGroup(
            JPFisicoClubLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPFisicoClubLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(JPcontacto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(JPClub, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(22, 22, 22))
        );

        JTPdatosClub.addTab("Datos físicos del CLUB", JPFisicoClub);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(JTPdatosClub, javax.swing.GroupLayout.PREFERRED_SIZE, 560, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(JTPdatosClub, javax.swing.GroupLayout.PREFERRED_SIZE, 303, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel JLDireccion;
    private javax.swing.JLabel JLFax;
    private javax.swing.JLabel JLMovil;
    private javax.swing.JLabel JLNombre;
    private javax.swing.JLabel JLPoblacion;
    private javax.swing.JLabel JLProvincia;
    private javax.swing.JLabel JLTelefono;
    private javax.swing.JLabel JLcolorCamisetas;
    private javax.swing.JLabel JLdni;
    private javax.swing.JLabel JLemail;
    private javax.swing.JLabel JLmarcaBola;
    private javax.swing.JLabel JLnumero;
    private javax.swing.JLabel JLpersonaContacto;
    private javax.swing.JPanel JPClub;
    private javax.swing.JPanel JPDatosClub;
    private javax.swing.JPanel JPFisicoClub;
    private javax.swing.JPanel JPcontacto;
    private javax.swing.JTextField JTFDireccion;
    private javax.swing.JTextField JTFFax;
    private javax.swing.JTextField JTFMovil;
    private javax.swing.JTextField JTFNombre;
    private javax.swing.JTextField JTFPoblacion;
    private javax.swing.JTextField JTFProvincia;
    private javax.swing.JTextField JTFTelefono;
    private javax.swing.JTextField JTFcolorCamisetas;
    private javax.swing.JTextField JTFdni;
    private javax.swing.JTextField JTFemail;
    private javax.swing.JTextField JTFmarcaBola;
    private javax.swing.JTextField JTFnumero;
    private javax.swing.JTextField JTFpersonaContacto;
    private javax.swing.JTabbedPane JTPdatosClub;
    // End of variables declaration//GEN-END:variables


   


    // Metodo que borra todos los campos del mantenimiento de clubs
    @Override
    public void clearTextFields() {
        JTFDireccion.setText("");
        JTFFax.setText("");
        JTFMovil.setText("");
        JTFNombre.setText("");
        JTFPoblacion.setText("");
        JTFProvincia.setText("");
        JTFTelefono.setText("");
        JTFcolorCamisetas.setText("");
        JTFdni.setText("");
        JTFemail.setText("");
        JTFmarcaBola.setText("");
        JTFnumero.setText("");
        JTFpersonaContacto.setText("");
    }

}
